package priv.cwr.springboot.demo.component;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * User: R
 * Date: 2018/7/23
 * Time: 15:50
 * Created with IntelliJ IDEA.
 */
@Component
@ConfigurationProperties(prefix = Errors.ERROR_PREFIX)
@Validated
@Data
public class Errors {
    public static final String ERROR_PREFIX = "error-message";
    @NotNull
    public Map<Integer, String> errors;
}
